{include file='header.tpl'}
{include file='admin/leftcol.tpl'}
<div id="left-area">
    <div class="entry post clearfix width-for-all-img">
        <div class="breadcrumb">
            <span class="raquo"></span><a href="/">Главная</a>
            <span class="raquo"> &raquo; </span><a href="{geturl controller="admin" action="tarif"}">Оплата</a>  

        </div>
        <h1 class="category-title">Выбор оплаты</h1> 

      
        <div class="form"> 
            <form method="post" action="{geturl action='privatquery'}">

               <!-- <div class="row">
                    <label>Выберите способ оплаты: </label>    
                    <input type="radio" name="name" value="1"/>LiqPay 
                    <input type="radio" name="name" value="2"/>Privat24
                </div>-->
                <div class="row">
                    <label>Тариф: </label>   
                    <select name="tarif" id="tarif" > 
                        <option value="-1">Выберите тариф</option>
                       {foreach from=$tarif item='item'}
                        <option value="{$item->getId()}">{$item->name}</option>
                        {/foreach}
                    </select>
                </div>
                <div class="row">
                    <label>Длительность: </label>      
                    <select name="period" id="period"  onchange="updateSum('month')">
                            <option value="-1">Выберите количество месяцев</option>
                            <option id="term-1" value="1">1 месяц</option>
                            <option id="term-2" value="2">2 месяца</option>
                            <option id="term-3" value="3">3 месяца</option>
                            <option id="term-4" value="4">4 месяца</option>
                            <option id="term-6" value="6">6 месяцев</option>
                        </select>
                </div>
                <div class="row">
                    <label>Сумма: <span id="price"></span></label>      
                    <input type="hidden" name="price" />
                </div>

                <div class="submit"><input type="submit" class="button green-pink" value="Дальше" /></div>

            </form>

        </div> 

    </div>
                    {literal}
                        <script>
                            function updateSum(id)
                            {
                                var tarif = $("#tarif").val();
                                
                                if (tarif!='-1')
                                var month = $("#period").val();
                          
                            if (month!='-1')
                            {
                                $("#price").html(tarif*month+' грн');
                                $("input[name='price']").val(tarif*month);
                            }
                            }
                        </script>
                        {/literal}
    {include file='footer.tpl'}